export const employeeDutySourceMap = [
  { label: 'PC端', value: '0' },
  { label: '扫码上车', value: '1' },
  { label: '扫码上车', value: '2' },
  { label: '一体机分配', value: '3' }
]

const stateMap = [
  { label: '未排班', value: '0', color: 'danger' },
  { label: '已排班', value: '1', color: 'success' }
]

export const columns: BasicGridColumnProps[] = [
  {
    title: '机台号',
    field: 'machineName',
    minWidth: 140
  },
  {
    title: '工种',
    field: 'title',
    minWidth: 120
  },

  {
    title: '看台人',
    field: 'personName',
    minWidth: 140
  },
  {
    title: '状态',
    field: 'state',
    cellRender: { name: 'ElTag', options: stateMap }
  },
  {
    title: '记录时间',
    field: 'scanTime'
  },
  {
    title: '权重',
    field: 'ratio'
  }
]

// 排班模式
export const actionColumns: BasicGridColumnProps[] = columns.concat([
  {
    title: '来源',
    field: 'employeeDutySourceStr',
    // cellRender: { name: 'ElTag', options: employeeDutySourceMap, props: { isTag: false } },
    minWidth: 100
  },
  {
    title: '备注',
    field: 'remark',
    minWidth: 100
  },
  {
    title: '操作',
    fixed: 'right',
    field: 'vxe-action', // 非数据字段,统一添加前缀标识
    slots: { default: 'action' },
    width: 80
  }
])

export const searchFormItems: BasicFormItemProps[] = []
